﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using BonsaiScrum.Mvc.Validation;
using BonsaiScrum.Core.Domain;
using System.Collections;
using BonsaiScrum.Core.Query;

namespace BonsaiScrum.Mvc.Models
{
    [PropertiesMustMatch("NewPassword", "ConfirmPassword", ErrorMessage = "The new password and confirmation password do not match.")]
    public class ChangePasswordModel
    {
        [Required]
        [DataType(DataType.Password)]
        [DisplayName("Current password")]
        public string OldPassword { get; set; }

        [Required]
        [ValidatePasswordLength]
        [DataType(DataType.Password)]
        [DisplayName("New password")]
        public string NewPassword { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [DisplayName("Confirm new password")]
        public string ConfirmPassword { get; set; }
    }

    public class LogOnModel
    {
        [Required]
        [DisplayName("User name")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [DisplayName("Password")]
        public string Password { get; set; }

        [DisplayName("Remember me?")]
        public bool RememberMe { get; set; }
    }

    [PropertiesMustMatch("Password", "ConfirmPassword", ErrorMessage = "The password and confirmation password do not match.")]
    public class CreateUserModel
    {
        [Required]
        [DisplayName("User name")]
        [StringLength(50)]
        public string UserName { get; set; }

        [Required]
        [ValidatePasswordLength]
        [DataType(DataType.Password)]
        [DisplayName("Password")]
        [StringLength(50)]
        public string Password { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [DisplayName("Confirm password")]
        public string ConfirmPassword { get; set; }


        [Required]
        [DisplayName("First Name")]
        [StringLength(50)]
        public string FirstName { get; set; }

        [Required]
        [DisplayName("Last Name")]
        [StringLength(50)]
        public string LastName { get; set; }

        [Required]
        [DisplayName("Permission Level")]
        public string PermissionLevel { get; set; }

        public SelectList PermissionLevels { get; set; }

        public ICollection<UserReport> Users { get; set; }
    }

    public class UserStatusModel
    {
        [Required]
        [DisplayName("User ID")]
        public string UserId { get; set; }

        [DisplayName("User Name")]
        [StringLength(50)]
        public string UserName { get; set; }

        [DisplayName("User Status")]
        public string UserStatus { get; set; }
        
        public SelectList Roles { get; set; }

    }

    public class DisableUserModel
    {
        [Required]
        [HiddenInput(DisplayValue = false)]
        public int UserId { get; set; }


        public SelectList Users { get; set; }
    }

}
